package cn.edu.scau.cmi.yeshaoying.client;

import java.io.IOException;

import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.stage.Stage;

public class ComprehensiveController {
	@FXML
    private Button b0, b1, b2, b3;
    
    Parent root0, root1, root2, root3;
    Stage stage0, stage1, stage2, stage3;
    
    public void initialize() {
    	try {
			root0 = FXMLLoader.load(getClass().getResource("/cn/edu/scau/cmi/yeshaoying/client/SingletonFX.fxml"));
			root1 = FXMLLoader.load(getClass().getResource("/cn/edu/scau/cmi/yeshaoying/client/FactoryMethodFX.fxml"));
			root2 = FXMLLoader.load(getClass().getResource("/cn/edu/scau/cmi/yeshaoying/client/AdapterFX.fxml"));
			root3 = FXMLLoader.load(getClass().getResource("/cn/edu/scau/cmi/yeshaoying/client/CompositeFX.fxml"));
			stage0 = new Stage();
			stage1 = new Stage();
			stage2 = new Stage();
			stage3 = new Stage();
			stage0.setScene(new Scene(root0));
			stage1.setScene(new Scene(root1));
			stage2.setScene(new Scene(root2));
			stage3.setScene(new Scene(root3));
		} catch (IOException e) {
			e.printStackTrace();
		}
    }
    
    @FXML
    void w0(ActionEvent event) {
    	stage0.show();
    }

    @FXML
    void w1(ActionEvent event) {
    	stage1.show();
    }

    @FXML
    void w2(ActionEvent event) {
    	stage2.show();
    }

    @FXML
    void w3(ActionEvent event) {
    	stage3.show();
    }
}
